package com.hengyuan.aidog.controller;

import com.hengyuan.aidog.model.User;
import com.hengyuan.aidog.result.Result;
import com.hengyuan.aidog.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController(value = "/user")
public class UserController {

    @Resource
    UserService userService;

    /**
     * @Description :
     * 1，先查询是否已经注册，如果注册返回 注册成功
     * 2，如果没注册，则注册，进入返回登录成功
     * @return 返回数据对象
     */
    @PostMapping("/login.do")
    public Result login(@RequestBody User user){
        return userService.loginUser(user);
    }



}
